﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Framework;


namespace Lab
{
    class Program
    {
        static void Main(string[] args)
        {
            var win = new Window();
            Application.Run(win);
        }

        public void PropertyDemo()
        {
            var a = new UIElement();
            Console.WriteLine(a.GetProp("Opacity"));
            a.SetProp("Opacity",2.0);
            Console.WriteLine(a.GetProp("Opacity"));

            var b = new Control();
            Console.WriteLine(b.GetProp("MyOpacity"));
            b.SetProp("MyOpacity",2.0);
            Console.WriteLine(b.GetProp("MyOpacity"));

            Console.WriteLine(b.GetProp("Control|Outter"));
        }
    }

    class Control : UIElement
    {
        static Control()
        {
             RegisterType(typeof(Control));
             RegisterType(typeof(Control),typeof(UIElement));

             RegisterProp(typeof(Control), "MyOpacity",typeof(double),3.0);
             RegisterProp(typeof(Control), "MyIsHitTestVisible", typeof(bool), true);
             
             //这个是附加属性
             RegisterProp(typeof(Control), "Outter", typeof(bool), true);
        }

    }
}
